package com.kyle.mapper;

import com.kyle.pojo.Dept;
import org.apache.ibatis.annotations.*;

/**
 * @Author：kyle_fu
 * @description:
 * @Date：2023/12/31 12:36
 * @version: 1.0
 */
public interface DeptMapper {

    Dept findDeptByDeptno(Integer deptno);

    @Select("select * from dept where deptno = #{deptno}")
    Dept findByDeptno(@Param("deptno") Integer deptno);

    @Update("update dept set dname =#{dname}, loc =#{loc} where deptno =#{deptno}")
    int updateDept(Dept dept);

    @Insert("insert into dept values(DEFAULT,#{dname},#{loc})")
    int addDept(Dept dept);

    @Delete("delete from dept where deptno =#{deptno}")
    int removeDept(int deptno);

}
